package com.hk.mini;


import lombok.Data;

@Data
public class TagCommond {
    /**
     * mini主机id
     */
    private String miniId;
    /**
     * 分模块/从机id
     */
    private String modAddr;

    /**
     * 标签个数
     */
    private int uNum;

    /**
     * 标签码
     */
    private String tag;

    public TagCommond(String code) {
        this.miniId= Long.valueOf(code.substring(14,22),16)+"";
        this.modAddr = String.format("%02d", Integer.valueOf(code.substring(22,24),16));
        //code.substring(26, 28) =寄存器个数*2
        this.uNum= MBUtil.hexStringToInt(code.substring(26, 28))/4;
        this.tag=code.substring(28,code.length()-4);
    }
}
